﻿<%@ Page Title="" Language="C#" MasterPageFile="~/html/MyBlog.Master" AutoEventWireup="true" CodeBehind="ArticleList.aspx.cs" Inherits="HelloLLLLL.Blog.html.ArticleList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>点滴积累</title>
    <script src="../Admin/lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
    <script>  
        layui.use(['laypage', 'jquery'], function () {
            var laypage = layui.laypage;
            var jj = 0;
            var artType = "<%=ArtType%>";
            var recordTime = "<%=RecordTime%>";
            var url1 = "";
           

            laypage.render({
                elem: 'demo1'
                , count: <%=PageCount%>//数据总数
                ,limit:12
                , jump: function (obj) {
                    if (artType != "") {
                        url1 = "/FrontEnd.ashx?action=listArticle&page=" + obj.curr + "&limit=" + obj.limit + "&artType=" + artType;
                    }
                    else if (recordTime != "") {
                        url1 = "/FrontEnd.ashx?action=listArticle&page=" + obj.curr + "&limit=" + obj.limit + "&recorTime=" + recordTime;
                    }
                    else {
                        url1 = "/FrontEnd.ashx?action=listArticle&page=" + obj.curr + "&limit=" + obj.limit
                    }
                    $.ajax(
                        {
                            url: url1,
                            type: "get",
                            dataType: "JSON",
                            success: function (dd) {


                                if (dd.code == 1) {

                                    var str = '<p class="left-box-title shadow"><i class="fa fa-cog fa-spin fa-fw" aria-hidden="true"></i>全部文章</p> ';

                                    for (var i = 0; i < dd.data.length; i++) {
                                        var item = dd.data[i];
                                        
                                        var type = "";
                                        for (var j = 0; j < item.ArtType.length; j++) {
                                            type += '<span class="layui-hide-xs"><i class="fa fa-tag" aria-hidden="true"></i>&nbsp;<a style = "color:#009688" href = "articleList.aspx?typeId=' + item.ArtType[j] + '" >' + item.ArtTypeName[j] + '</a ></span >'
                                        }


                                        var content = '<div class="article shadow clearfix">'
                                            + '<div class="article-left" >'
                                            + ' <img src="' + item.HomeImg + '"'
                                            + 'alt = ' + item.Title + '>'
                                            + ' </div> <div class="article-right"><div class="article-title">'
                                            + ' <a href="Detail.aspx?Id=' + item.Id+'">' + item.Title + '</a></div><div class="article-abstract">'
                                            + item.Digest + '</div><div class="article-footer">'
                                            + type
                                            + '<span><i class="fa fa-clock-o" aria-hidden="true"></i>&nbsp;' + item.CreateTime + '</span>'
                                            + '<span class="article-viewinfo">' + item.ReadCount + '阅</span>'
                                            + '<span class="article-viewinfo">' + item.CommentCount + '评</span>'
                                            + '<span class="article-viewinfo">' + item.PresentCount + '赞</span>'
                                            + '<a class="read layui-btn layui-btn-xs layui-btn-normal layui-hide-xs"'
                                            + 'href="Detail.aspx?Id=' + item.Id + '" title="阅读全文：' + item.Title + '">阅读全文</a>'
                                            + '</div>'
                                            + '</div>'
                                            + '</div>';
                                        str += content;

                                    }

                                    $(".left-box").html(str);

                                }
                                else {
                                    layer.msg(dd.code);
                                }
                            }
                        }
                    )
                }
            });
        })
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <div class="layui-container">
            <blockquote class="layui-elem-quote sitemap shadow">
                <i class="layui-icon"></i>
                <span class="layui-breadcrumb" lay-separator=">" style="visibility: visible;">
                    <a href="/html/Index.aspx">首页</a><span lay-separator="">&gt;</span>
                    <a><cite>点点滴滴</cite></a>
                </span>
            </blockquote>
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md8">
                    <div class="left-box">
                       
                    </div>
                <div class="blog-pagebox">
                    <div id="demo1"></div>
                        </div>

                </div>
                <div class="layui-col-md4">
                    <div class="layui-row layui-col-space10">
                        <div class="layui-col-sm6 layui-col-md12 layui-hide-xs layui-hide-sm">
                            <div class="blog-search">
                                <form class="layui-form" action="">
                                    <div class="layui-form-item">
                                        <div class="search-keywords  shadow">
                                            <input type="text" name="keywords" lay-verify="required"
                                                placeholder="输入关键词搜索" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="search-submit  shadow">
                                            <a class="search-btn" lay-submit="formSearch" lay-filter="formSearch"><i
                                                    class="fa fa-search"></i></a>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <div class="layui-col-sm6 layui-col-md12 padding0">
                            <div class="article-category shadow">
                                <div class="article-category-title">分类导航</div>
                                
                                <%if (listType != null)
                                        {
                                            for (int t = 0; t < listType.Count; t++)
                                            { %>
                                 <a href="ArticleList.aspx?typeId=<%=listType[t].Id%>"><%=listType[t].TypeName %></a>
                                <%}
                                        } %>
                              
                                <div class="clear"></div>
                            </div>
                        </div>
                        <%--<div class="layui-col-sm6 layui-col-md12">
                            <div class="blog-card">
                                <div class="blog-card-title">
                                    <span class="icon"><i class="layui-icon" aria-hidden="true"></i></span>
                                    <span class="text">作者推荐</span>
                                </div>
                                <ul class="blog-card-ul">
                                    <li>
                                        <span class="layui-badge ">1</span><a href="detail.html"
                                            title=".NET Core 3.0正式版发布">.NET Core 3.0正式版发布</a>
                                    </li>
                                    <li>
                                        <span class="layui-badge ">2</span><a href="detail.html"
                                            title="JS动画效果之妙用Animate.css">JS动画效果之妙用Animate.css</a>
                                    </li>
                                    <li>
                                        <span class="layui-badge ">3</span><a href="detail.html"
                                            title="使用ASP.NET Core SignalR搭建聊天室（本站聊天室）">使用ASP.NET Core
                                            SignalR搭建聊天室（本站聊天室）</a>
                                    </li>
                                    <li>
                                        <span class="layui-badge layui-bg-blue">4</span><a href="detail.html"
                                            title="小程序黑科技之获取手机号码、通讯地址、地理位置">小程序黑科技之获取手机号码、通讯地址、地理位置</a>
                                    </li>
                                    <li>
                                        <span class="layui-badge layui-bg-blue">5</span><a href="detail.html"
                                            title="ASP.NET Core第三方认证之QQ登录">ASP.NET Core第三方认证之QQ登录</a>
                                    </li>
                                </ul>
                            </div>
                        </div>--%>
                        <div class="layui-col-sm6 layui-col-md12">
                            <div class="blog-card shadow sr-rightmodule">
                                <div class="blog-card-title">
                                    <span class="icon"><i class="layui-icon" aria-hidden="true"></i></span>
                                    <span class="text">随便看看</span>
                                </div>
                                <ul class="blog-card-ul">
                                    
                                    <%if (ListRandom != null)
                                        {
                                            for (int i = 0; i < ListRandom.Count; i++)
                                            {


                                            %>
                                    
                                    <li>
                                        <%if (i < 3)
                                            { %>
                                        <span class="layui-badge "><%=i+1 %></span><%}
                                            else
                                            { %><span class="layui-badge layui-bg-blue"><%=i+1 %></span>
                                        
                                        <%} %>
                                        <a href="Detail.aspx?Id=<%=ListRandom[i].Id%>"
                                            title="<%=ListRandom[i].Title %>"><%=ListRandom[i].Title%></a>
                                    </li>
                                    <%}} %>
                                </ul>
                            </div>
                        </div>
                    
                    <div class="layui-col-sm6 layui-col-md12">
                            <div class="blog-card">
                                <div class="blog-card-title">
                                    <span class="icon"><i class="layui-icon" aria-hidden="true"></i></span>
                                    <span class="text">文章归档</span>
                                </div>
                                <ul class="blog-card-ul">
                                    <%if (DtRecord == null || DtRecord.Rows.Count == 0){%>
                                    <li>没有数据</li>
                                    <%}else{ %>
                                    <%for (int i = 0; i < DtRecord.Rows.Count; i++){ %>
                                    
                                    <%var tt = DtRecord.Rows[i][1].ToString()
                                                .Split(new char[1] {' '},StringSplitOptions.RemoveEmptyEntries);

                                        var time = tt[0] + "-" + tt[1];

                                        var timeStr = tt[0] + "年" + tt[1] + "月";

                                        %>
                                    
                                    <li>
                                        <a href="ArticleList.aspx?recordTime=<%=time%>"><%=timeStr%>&nbsp;&nbsp;&nbsp(<%=DtRecord.Rows[i][0]%>)</a>
                                    </li>
                                    <%}} %>
                                    </ul>
                                </div>
                        </div>
                        
                    </div>
                    <!--右边悬浮 平板或手机设备显示-->
                    <div class="category-toggle"><i class="fa fa-chevron-left"></i></div>
                </div>
            </div>
        </div>
</asp:Content>
